<?php

namespace App\Http\Requests\Api\v1;

use Illuminate\Foundation\Http\FormRequest;

class UserRequest extends FormRequest
{
    public function rules(): array
    {
        switch ($this->method()){
            case 'POST':
                return [
                    //'phone' => 'required|regex:/^[56789][0-9]{9}$/',  // 手机号
                    //'phone' => 'required|numeric|digits_between:9,11',  // 手机号
                    //'password' => 'required|min:6',
                ];
                break;
            case 'PATCH':
                return [
                    'avatar' => 'string',
                    'shoptype' => 'numeric|between:0,1',
                    'shopname' => 'string',
                    'shopdesc' => 'string',
                    'identity' => 'string'
                ];
                break;
        }

    }
}
